package com.gzy.rpsm_property.mapper;

import com.gzy.rpsm_property.pojo.FreightBasis;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;


//查询费率
@Repository
public interface FreightBasisMapper {
    @Select("select * from freight_basis")
    List<FreightBasis> findAll();

//    修改费率
    @Update("<script>update freight_basis" +
            " <set>" +
            "            <if test='price != null'>" +
            "            price = #{price}," +
            "            </if>" +
            "            <if test=\"intro != null and intro != ''\">" +
            "            intro = #{intro}," +
            "                    </if>" +
            "            <if test=\"basis_name != null and            basis_name != ''\">" +
            "            basis_name = #{basis_name}," +
            "                    </if>" +
            "            </set>" +
            "            where freight_basis_id =            #{freight_basis_id}</script>")
    int updateById(FreightBasis fh);
}
